BeliefUpdates:
  { true }  SetResult(X) { result(X) }
  { buyersValue(T, OV, OS) }  UpdateBuyersValue(T, V, S) { not buyersValue(T, OV, OS), buyersValue(T, V , S) }

Beliefs:
  buyersValue(hamlet, 40, temporary).
  knowPersonalValue(hamlet) :- buyersValue(hamlet, _, final).
  
Goals:
  knowPersonalValue(hamlet)
     
PG-rules:
   knowPersonalValue(Title) <- true | 
   {  	
   	  create(buyer, buyer_t); 
   	  
   	  while buyer_t.B(available(DS,DT,DP)) do
   	  {	
   	  		buyer_t.updateBB( not available(DS, DT, DP))
   	  };
   	  
   	  while B(buyersValue(Title, _, temporary)) do 
   	  {
   	    clone(buyer_t, buyer);
   	    B(buyersValue(Title, Value, _));
   	    buyer.updateBB(available(peter, Title, Value));
   	    buyer.execute(P(send or externalaction));
   	    
   	    if buyer.G(buy(Title)) then 
   	    {
   	    	UpdateBuyersValue(Title, Value, final)
   	    }
   	    else
   	    {
   	    	 B(is(NV, Value - 1));
   	    	 UpdateBuyersValue(Title, NV, temporary) 
   	    };
   	    release(buyer) 	       
   	  }
   }